package inheritcommon;

/**
 * Created by pc on 3/27/16.
 */
public class RPG {
    public static void main(String[] args) {


        SwordsMan swordsMan = new SwordsMan();
        swordsMan.setName("Justin");
        swordsMan.setLevel(1);
        swordsMan.setBlood(200);

        Magician magician = new Magician();
        magician.setName("Monica");
        magician.setLevel(1);
        magician.setBlood(100);

        showBlood(swordsMan);
        showBlood(magician);

        drawFight(swordsMan);
        drawFight(magician);
    }

    static void showBlood(Role role) {
        System.out.printf("%s Blood %d%n", role.getName(), role.getBlood());
    }

    static void drawFight(Role role) {
        System.out.println(role.getName());
        role.fight();
    }
}
